Data parity for seasons and episodes#1593
Data parity for seasons and episodes#1593JonnyWong16 merged 20 commits intopushingkarmaorg:masterfrom
Conversation
…chSeasons() and searchEpisodes() methods and Show.seasons() and Season.episodes() methods
|
I'm out of depth trying to solve the failing CI step as I'm unfamiliar with Github actions, but I'll do some research and see if I can offer any solutions. |
|
The test failure is just a caching issue. |
There was a problem hiding this comment.
Pull request overview
Adds a TV parent/child relation key builder to align GUID inclusion across show/season/episode “member” retrieval methods with library search behavior (per #1592).
Changes:
- Introduces
TvParentChildMixin._buildRelationKey()to append relation query params (includingincludeGuidsby default). - Updates
Show,Season, andEpisoderetrieval methods to use_buildRelationKey()when fetching related objects. - Adds/updates tests to assert GUID presence on related objects without relying on auto-reload behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
plexapi/video.py |
Switches show/season/episode relation fetches to use _buildRelationKey() so returned partials include GUIDs. |
plexapi/mixins/tv_parent_child.py |
Adds the new key-building helper for TV parent/child relations. |
plexapi/mixins/__init__.py |
Wires the new mixin into ShowMixins, SeasonMixins, and EpisodeMixins. |
tests/test_video.py |
Adds assertions/tests to validate GUID availability for related TV objects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…_season(), separating XML attributes from key construction.
|
The change to the key-building implementation in
So sorry for the confusion! |
There was a problem hiding this comment.
Pull request overview
Adds a shared key-builder to ensure TV show/season/episode relationship fetches include GUIDs (matching LibrarySection.search() behavior), and updates the relevant member methods plus tests to validate guid presence on partial objects.
Changes:
- Introduce
TvParentChildMixin._buildRelationalKey()to consistently appendincludeGuids=1(and related query params) for parent/child fetch endpoints. - Update
Show,Season, andEpisoderelationship/object-retrieval methods to use_buildRelationalKey(...). - Add/extend unit tests to assert guid parity for show/season/episode relationship methods without triggering auto-reloads.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
plexapi/mixins/tv_parent_child.py |
New mixin to construct parent/child fetch keys with includeGuids=1. |
plexapi/mixins/__init__.py |
Wires TvParentChildMixin into ShowMixins, SeasonMixins, and EpisodeMixins. |
plexapi/video.py |
Switches TV relationship methods to use _buildRelationalKey(...) for guid parity. |
tests/test_video.py |
Adds tests verifying GUIDs are present on related partial objects without auto-reload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
JonnyWong16
left a comment
There was a problem hiding this comment.
One more change and it looks good.
Thanks for adding this.
|
Final thought ... originally the intent was to provide a key-builder for objects that had some kind of parent-child relationship (episode <-> season <-> show), hence the name Either way, thanks for your time and support. |
|
|
JonnyWong16
left a comment
There was a problem hiding this comment.
Looks good. Thanks.
Description
This PR includes a mixin supporting a key builder suitable for all TV parent/child searches, including guids unless specifically instructed otherwise, and implements it for all object-retrieving methods as described in #1592.
Fixes #1592
Type of change
Please delete options that are not relevant.
Checklist:
In all honesty I've had great difficulty setting up an 'all-tests-pass' test harness with tools/plex-bootstraptest.py, but I have been able to use it to create an environment that could run the new unit tests individually. The new tests all fail when the mixin's
_buildRelationKey()includeGuids code is commented out, and pass when it's reinstated, so I'm happy that the changes are effective and the unit tests are of value.Please feel free to make or suggest any changes that would help pull this PR into line with the spirit of this repo.